package com.mediacloud.app.newsmodule.activity.audio

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.mediacloud.app.assembly.util.StringUtils
import com.mediacloud.app.assembly.util.loadXWithRadiusGlide
import com.mediacloud.app.newsmodule.R
import com.mediacloud.app.newsmodule.model.PageRecord
import com.mediacloud.app.reslib.enums.AppFactoryGlobalConfig

class AudioAnchorWorksListAdapter :
    BaseQuickAdapter<PageRecord, BaseViewHolder>(R.layout.item_audio_anchor_works_list) {
    var radius = 6
    override fun convert(helper: BaseViewHolder, item: PageRecord?) {
        val audioAlbumLogo = helper.getView<ImageView>(R.id.iv_audio_detail_anchor_list)
        helper.setText(R.id.tv_audio_anchor_works_list_title, "${item?.title}")
            .setText(R.id.tv_audio_anchor_works_list_content, "${item?.summary}")
            .setText(R.id.tv_audio_anchor_works_list_time, "${item?.publishDate}")
            .setText(
                R.id.tv_audio_anchor_works_list_num,
                StringUtils.toTenThousand("${item?.hitCount}" + "浏览")
            )
        audioAlbumLogo?.loadXWithRadiusGlide(
            "${item?.logo}",
            radius,
            AppFactoryGlobalConfig.getDefaultImageLoadDrawable()
        )
    }

}